var  defaultInfo = {};


//NEWS API
defaultInfo.NEWS = "/news";
defaultInfo.ADD_NEWS = "/addNews";
defaultInfo.SEARCH_ALL_NEWS = "/searchNews";



//ERROR
//NEWS ERROR
defaultInfo.ERROR_NOT_VALIDITY_PARAM = {
	code:3000,
	message:"未传入指定的参数"
};
defaultInfo.ERROR_NEWS_ADD_FAIL={
	code:3000,
	message:"发布失败"
};
defaultInfo.NEWS_ADD_SUCCESS={
	code:2000,
	message:"发布成功"
};
defaultInfo.ERROR_NEWS_SEARCH_FAIL={
	code:3000,
	message:"查询失败"
};
defaultInfo.NEWS_SEARCH_SUCCESS={
	code:2000,
	message:"查询成功"
};





//配置数据库的信息
defaultInfo.DB_CONFIG = {
    host:"localhost",
    user:"root",
    password:"",
    database:"sharetime"
};


//SQL
//news
//创建news表
defaultInfo.SQL_CREATE_NEWS_TABLE="CREATE TABLE `sharetime`.`news` ( `newsID` BIGINT(100) NOT NULL AUTO_INCREMENT , `type` INT NOT NULL DEFAULT '0' , `userID` BIGINT(100) NOT NULL , `des` TEXT NOT NULL , `startTime` BIGINT(100) NOT NULL , `endTime` BIGINT(100) NOT NULL , `price` BIGINT(100) NOT NULL , `lat` DOUBLE NOT NULL , `log` DOUBLE NOT NULL , `isValidity` BOOLEAN NOT NULL DEFAULT FALSE , PRIMARY KEY (`newsID`));";
//插入一条记录
//var sql="INSERT INTO `news` (`newsID`, `type`, `userID`, `des`, `startTime`, `endTime`, `price`, `lat`, `log`, `isValidity`) VALUES (NULL, '0', '', '', '', '', '', '', '', '0')";
//defaultInfo.SQL_ADD_NEWS = sql;
defaultInfo.SQL_ADD_NEWS = "INSERT INTO `news` (`newsID`, `type`, `userID`, `des`, `startTime`, `endTime`, `price`, `lat`, `log`) VALUES (NULL,  ?, ?, ?, ?, ?, ?, ?, ?);";


//查询所有记录
defaultInfo.SQL_SEARCH_ALL_NEWS = "SELECT * FROM news;";



module.exports = defaultInfo;